<%@page import="com.skeleton.utils.BaseConstants"%>
<%@page import="com.skeleton.db.dto.UserinfoDto"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	UserinfoDto ud = (UserinfoDto) session.getAttribute(BaseConstants.LOGINUSER_SESSION_NAME);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>SkeTool</title>
<!-- 	<link rel="shortcut icon" href="http://www.ithome.com/favicon.ico"> -->
<!-- 	<link rel="shortcut icon" href="http://www.hao123.com/images/haofav.ico" type="image/x-icon" /> -->
	<link href="<%=request.getContextPath() %>/resource/css/sketoolweb-index.css" rel="stylesheet" type="text/css" />
	<script src="<%=request.getContextPath() %>/resource/js/jquery-1.8.2.js" type="text/javascript" charset="utf-8"></script>
	<script src="<%=request.getContextPath() %>/resource/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
	<script src="<%=request.getContextPath() %>/resource/js/jquery.blockUI.js" type="text/javascript" charset="utf-8"></script>
	<script src="<%=request.getContextPath() %>/resource/js/ske-constants.js" type="text/javascript" charset="utf-8"></script>
	<script src="<%=request.getContextPath() %>/resource/js/ske-common.js" type="text/javascript" charset="utf-8"></script>
	<script src="<%=request.getContextPath() %>/resource/js/ske-encrypt.js" type="text/javascript" charset="utf-8"></script>
	<script src="<%=request.getContextPath() %>/resource/js/sketoolweb-index.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		var isLogin = 0;
		<%
			if (ud != null) {
		%>
			isLogin = 1;
		<%
			}
		%>
		$(function() {
			if(isLogin != 1) {
				autoLogin();
			}
			ajaxLoadHotGuide();
 			ajaxLoadGuide();
			ajaxLoadCatgList();
			if(isLogin == 1) {
				$('#myGuideTitle').click();
			}
		});
	</script>
</head>
<body>
	<div class="common-width-all head">
		<div class="float-margin fleft">
			欢迎来到SkeToolWeb
		</div>
		<%
			if(ud != null) {
		%>
			<div class="fright" id="userinfo_login" style="display: none;">
		<%
			} else {
		%>
			<div class="fright" id="userinfo_login">
		<%
			}
		%>
			<div class="float-margin fleft">
				<a href="javascript: showLogin()">登录</a>
			</div>
			<div class="fleft">
				|
			</div> 
			<div class="float-margin fleft">
				<a href="javascript: fastRegist()">注册</a>
			</div>
			<div class="cboth"></div>
		</div>
		<%
			if(ud != null) {
		%>
			<div class="fright" id="userinfo">
		<%
			} else {
		%>
			<div class="fright" id="userinfo" style="display: none;">
		<%
			}
		%>
			<div class="float-margin fleft" id="userinfo-login-name">
			<%
				if(ud != null) {
					out.println(ud.getUserLoginname());
				}
			%>
			</div>
			<div class="fleft">
				|
			</div>
			<div class="float-margin fleft">
				<a href='#none' onclick='blockAlert("该功能暂未开放")'>修改资料</a>
			</div>
			<div class="fleft">
				|
			</div>
			<div class="float-margin fleft">
				<a href="javascript: logout()">注销</a>
			</div>
			<div class="cboth"></div>
		</div>
		<div class="cboth"></div>
	</div>
	<div class="common-width-center guide">
		<div class="guide-head">
			<div class="guide-title-focus float-margin fleft" id="hotGuideTitle" onclick="clickHotGuide()">
				热门导航
			</div>
			<div class="guide-title-no float-margin fleft" id="myGuideTitle" onclick="clickMyGuide()">
				我的导航
			</div> 
			<div class="fright" style="display: none;" id="guide-title1">
				<div class="float-margin fleft">
					<a href="javascript: showAddItem('-1')">添加</a>
				</div>
				<div class="fleft">
					|
				</div>
				<div class="float-margin fleft">
					<a href="javascript: showModifyGuide()">编辑</a>
				</div>
				<div class="cboth"></div>
			</div>
			<div class="fright" style="display: none;" id="guide-title2">
				<div class="float-margin fleft">
					<a href="javascript: hideModifyGuide()">取消编辑</a>
				</div>
			</div>
			<div class="cboth"></div>
		</div>
		<div class="guide-center guide-center-normal" id="hot-guide-show">
			正在加载。。。
		</div>
		<div class="guide-center guide-center-normal" id="my-guide-show" style="display: none;">
			请登录
		</div>
	</div>
	
	<div id="fast-regist" class="block-ui" style="display: none;">
		<div class="block-all-margin"">
			<div class="block-title">
				<div class="fleft" id="block-title-catg">
					快速注册
				</div>
				<div class="fright">
					<a href="javascript: closeBlockUI();">X</a> 
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
					用户名：
				</div>
				<div class="block-input fleft">
					<input type="text" id="regist-loginname"/>
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
					密码：
				</div>
				<div class="block-input fleft">
					<input type="password" id="regist-password"/>
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
					重复密码：
				</div>
				<div class="block-input fleft">
					<input type="password" id="regist-password2"/>
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
				</div>
				<div class="block-input fleft">
					<input type="button" value="注册" id="block-input-add-user" onclick="ajaxRegist()"/>
					<input type="button" value="取消" onclick="closeBlockUI()"/>
				</div>
				<div class="cboth"></div>
			</div>
			<input type="hidden" id="block-input-hidden-catg-id" value=""/>
		</div>
	</div>
	
	
	<div id="add-item" class="block-ui" style="display: none;">
		<div class="block-all-margin"">
			<div class="block-title">
				<div class="fleft" id="block-title-item">
				</div>
				<div class="fright">
					<a href="javascript: closeBlockUI();">X</a> 
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
					标题：
				</div>
				<div class="block-input fleft">
					<input type="text" id="guide-title-item"/>
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
					网址：
				</div>
				<div class="block-input fleft">
					<input type="text" id="guide-url-item" style="width: 300px;"/>
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
					分类：
				</div>
				<div class="block-input fleft">
					<div id="addItem-catg1">
						<select id="guide-catg-select">
							<option value="-1">请选择分类</option>
						</select>
					</div>
					<div id="addItem-catg2" style="display: none;">
						<input type="text" id="guide-catg-add"/>
					</div>
				</div>
				<div class="block-info fleft">
					<div id="addItem-catg-button1">
						<a href="javascript: showAddCatg()"> + 添加分类</a>
					</div>
					<div id="addItem-catg-button2" style="display: none;">
						<a href='javascript: ajaxAddCatg()'>添加</a> | <a href='javascript: hideAddCatg()'>取消</a>
					</div>
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
				</div>
				<div class="block-input fleft">
					<input type="button" value="添加" id="block-input-add-item" onclick="ajaxAddItem()"/>
					<input type="button" value="修改" id="block-input-modify-item" onclick="ajaxModifyItem()"/>
					<input type="button" value="取消" onclick="closeBlockUI()"/>
				</div>
				<div class="cboth"></div>
			</div>
			<input type="hidden" id="block-input-hidden-item-id" value=""/>
		</div>
	</div>
	
	<div id="add-catg" class="block-ui" style="display: none;">
		<div class="block-all-margin"">
			<div class="block-title">
				<div class="fleft" id="block-title-catg">
				</div>
				<div class="fright">
					<a href="javascript: closeBlockUI();">X</a> 
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
					标题：
				</div>
				<div class="block-input fleft">
					<input type="text" id="guide-title-catg"/>
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
				</div>
				<div class="block-input fleft">
					<input type="button" value="添加" id="block-input-add-catg" onclick="ajaxAddCatg()"/>
					<input type="button" value="修改" id="block-input-modify-catg" onclick="ajaxModifyCatg()"/>
					<input type="button" value="取消" onclick="closeBlockUI()"/>
				</div>
				<div class="cboth"></div>
			</div>
			<input type="hidden" id="block-input-hidden-catg-id" value=""/>
		</div>
	</div>
	
	<div id="user-login" class="block-ui" style="display: none;">
		<div class="block-all-margin"">
			<div class="block-title">
				<div class="fleft">
					用户登录
				</div>
				<div class="fright">
					<a href="javascript: closeBlockUI();">X</a> 
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
					登录名：
				</div>
				<div class="block-input fleft">
					<input type="text" id="loginname"/>
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
					密码：
				</div>
				<div class="block-input fleft">
					<input type="password" id="password"/>
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
					自动登录：
				</div>
				<div class="block-input fleft">
					<input type="checkbox" id="is_remenber"/>
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-label fleft">
				</div>
				<div class="block-input fleft">
					<input type="button" value="登录" onclick="login()"/>
					<input type="button" value="取消" onclick="closeBlockUI()"/>
					<a href="">注册新账号</a>
				</div>
				<div class="cboth"></div>
			</div>
		</div>
	</div>
	
	<div id="block-alert" class="block-ui" style="display: none;">
		<div class="block-all-margin"">
			<div class="block-title">
				<div class="fleft" id="block-title-remenber">
					系统信息
				</div>
				<div class="fright">
					<a href="javascript: closeBlockUI();">X</a> 
				</div>
				<div class="cboth"></div>
			</div>
			<div class="block-center">
				<div class="block-msg" id="block-msg">
				</div>
				<div class="cboth"></div>
			</div> 
 		</div>
	</div>
	
</body>
</html>